using System;
using System.Collections.Generic;
using System.Windows;
using PropertyChanged;
using WPFTemplateLib.WpfHelpers;

namespace WPFPractice.Dialogs
{
	/// <summary>
	/// 选择枚举项通用窗口（显示枚举描述）
	/// </summary>
	[AddINotifyPropertyChangedInterface]
	public partial class SelectEnumItemDialog : Window
	{
		#region 成员&构造
		
		private SelectEnumItemDialog()
		{
			InitializeComponent();
		}

		public SelectEnumItemDialog(string titleName, IEnumerable<Enum> options, Enum selectedItem) : this()
		{
			TitleName = titleName;
			Options = options;
			SelectedItem = selectedItem;

			Owner = WpfWindowHelper.GetActiveWindow();
		} 
		
		#endregion

		#region 绑定

		/// <summary>
		/// 标题名称
		/// </summary>
		public string TitleName { get; set; }

		/// <summary>
		/// 候选项（枚举集合）
		/// </summary>
		public IEnumerable<Enum> Options { get; set; }

		/// <summary>
		/// 选择项（枚举）
		/// </summary>
		public Enum SelectedItem { get; set; }

		#endregion
	}
}
